#ifndef PARAMTYPEDELEGATE_H
#define PARAMTYPEDELEGATE_H

// 参考 https://www.cnblogs.com/jiangson/p/6900255.html

#include <QObject>
#include <QItemDelegate>
#include <QComboBox>

#define  COMBOXCOL 1

class ParamTypeDelegate : public QItemDelegate
{
    Q_OBJECT
public:
    ParamTypeDelegate(QObject* parent=nullptr);
    ~ParamTypeDelegate();

    // QAbstractItemDelegate interface
public:
    void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;

private:
    QStringList m_typeList;

};

#endif // PARAMTYPEDELEGATE_H
